<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title>box-align</title>
<meta name="description" content="CSS3参考手册伸缩盒之: box-align" />
<meta name="keywords" content="box-align, flexbox, 伸缩盒, css3, css3参考手册" />
<meta name="author" content="Joy Du(飘零雾雨), dooyoe@gmail.com, www.doyoe.com" />
<meta name="robots" content="all" />
<!--[if lte IE 8]>
<script src="../../js/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="../../skin/article.css" />
</head>
<body>
<nav id="guide" class="g-mod">
	<div class="from">
		<a href="http://css.doyoe.com/" target="_blank">CSS3参考手册</a>
		<span>&#187;</span>
		<a href="../index.htm">属性列表</a>
		<span>&#187;</span>
		<a href="index.htm" id="category" rel="properties/flexible-box" name="box-align">伸缩盒属性</a>
		<span>&#187;</span>
	</div>
	<div class="to">
		<span class="label">相关内容：</span>
		<div class="g-combobox g-transition">
			<a href="?" class="g-transition target">
				<strong>其它媒体查询属性</strong>
				<span>选择其它项<!--[if lte IE 7]><ins>IE7 and earlier, Get to die</ins><![endif]--></span>
			</a>
			<div class="g-transition list">
				<ul>
					<!-- 插入快速分类导航 -->
				</ul>
			</div>
		</div>
	</div>
</nav>
<header id="hd">
	<section id="title" class="g-mod">
		<h1 class="tit">box-align</h1>
		<ul class="info">
			<li><strong>版本：CSS3</strong></li>
			<li>媒体：视觉</li>
		</ul>
		<!-- 插入浏览器信息 -->
	</section>
</header>
<section id="bd">
	<section id="syntax" class="g-mod g-attr">
		<h2 class="tit">语法：</h2>
		<div class="cont">
			<p><strong>box-align</strong>：start | end | center | baseline | stretch</p>
			<p><strong>默认值</strong>：<mark class="defaultvalue">stretch</mark></p>
			<p><strong>适用于</strong>：伸缩盒容器</p>
			<p><strong>继承性</strong>：无</p>
			<p><strong>动画性</strong>：否</p>
			<p><strong>计算值</strong>：指定值</p>
		</div>
	</section>
	<section id="value" class="g-mod g-attr">
		<h2 class="tit">取值：</h2>
		<div class="cont">
			<dl>
				<dt>start：</dt>
				<dd>设置伸缩盒对象的子元素从开始位置对齐</dd>
				<dt>center：</dt>
				<dd>设置伸缩盒对象的子元素居中对齐</dd>
				<dt>end：</dt>
				<dd>设置伸缩盒对象的子元素从结束位置对齐</dd>
				<dt>baseline：</dt>
				<dd>设置伸缩盒对象的子元素基线对齐</dd>
				<dt>stretch：</dt>
				<dd>设置伸缩盒对象的子元素自适应父元素尺寸</dd>
			</dl>
		</div>
	</section>
	<section id="intro" class="g-mod g-attr">
		<h2 class="tit">说明：</h2>
		<div class="cont">
			<strong>设置或检索伸缩盒对象的子元素的对齐方式。</strong>查看其兄弟属性<a href="box-pack.htm">box-pack</a>，两者的效果正好（相反）互补
			<ul>
				<li>效果等同于过渡版本的flex-align属性和新版本的align-items属性；</li>
				<li>box-align的对齐方式受<a href="box-orient.htm">box-orient</a>影响；</li>
				<li>默认情况下（即box-orient设置为horizontal）start和end所呈现的效果等同于顶部对齐和底部对齐；</li>
				<li>当box-orient设置为vertical时，start和end所呈现的效果等同于左对齐和右对齐；</li>
				<li>对应的脚本特性为<strong>boxAlign</strong>。</li>
			</ul>
		</div>
	</section>
	<section id="compatible" class="g-mod g-attr">
		<h2 class="tit">兼容性：</h2>
		<div class="cont">
			<ul class="support-type">
				<li><span class="support">浅绿</span> = 支持</li>
				<li><span class="unsupport">红色</span> = 不支持</li>
				<li><span class="partsupport">粉色</span> = 部分支持</li>
			</ul>
			<table class="g-data">
				<thead>
					<tr>
						<th>Values</th>
						<th>IE</th>
						<th>Firefox</th>
						<th>Chrome</th>
						<th>Safari</th>
						<th>Opera</th>
						<th>iOS Safari</th>
						<th>Android Browser</th>
						<th>Android Chrome</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td><strong>Basic Support</strong></td>
						<td class="unsupport">6.0-11.0</td>
						<td class="support">2.0-40.0<sup class="fix">-moz-</sup></td>
						<td class="support">4.0-45.0<sup class="fix">-webkit-</sup></td>
						<td class="support">6.0-8.0<sup class="fix">-webkit-</sup></td>
						<td class="support">15.0-29.0<sup class="fix">-webkit-</sup></td>
						<td class="support">6.0-8.3<sup class="fix">-webkit-</sup></td>
						<td class="support">2.1-4.4.4<sup class="fix">-webkit-</sup></td>
						<td class="support">18.0-42.0<sup class="fix">-webkit-</sup></td>
					</tr>
				</tbody>
			</table>
		</div>
	</section>
	<section id="example" class="g-mod g-attr">
		<h2 class="tit">示例：</h2>
		<div class="cont">
			<textarea cols="90" rows="10">
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title>box-align_CSS参考手册_web前端开发参考手册系列</title>
<meta name="author" content="Joy Du(飘零雾雨), dooyoe@gmail.com, www.doyoe.com" />
<style>
h1{font:bold 20px/1.5 georgia,simsun,sans-serif;}
.box,.box2{display:-webkit-box;display:-moz-box;display:-ms-box;margin:0;padding:10px;background:#000;list-style:none;}
.box{-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-ms-box-orient:horizontal;width:260px;height:100px;}
.box2{-webkit-box-orient:vertical;-moz-box-orient:vertical;-ms-box-orient:vertical;width:100px;height:260px;}
.box0,.box06{-webkit-box-align:start;-moz-box-align:start;-ms-box-align:start;}
.box02,.box07{-webkit-box-align:center;-moz-box-align:center;-ms-box-align:center;}
.box03,.box08{-webkit-box-align:end;-moz-box-align:end;-ms-box-align:end;}
.box04,.box09{-webkit-box-align:baseline;-moz-box-align:baseline;-ms-box-align:baseline;}
.box05,.box010{-webkit-box-align:stretch;-moz-box-align:stretch;-ms-box-align:stretch;}
.box li,.box2 li{padding:10px;}
.box li:nth-child(1),.box2 li:nth-child(1){background:#666;}
.box li:nth-child(2),.box2 li:nth-child(2){background:#999;}
.box li:nth-child(3),.box2 li:nth-child(3){background:#ccc;}
</style>
</head>
<body>
<h1>横向排列时子元素从起始位置对齐 box-align:start;</h1>
<ul class="box0 box">
	<li>1</li>
	<li>2</li>
	<li>3</li>
</ul>
<h1>横向排列时子元素居中对齐 box-align:center;</h1>
<ul class="box02 box">
	<li>1</li>
	<li>2</li>
	<li>3</li>
</ul>
<h1>横向排列时子元素从结束位置对齐 box-align:end;</h1>
<ul class="box03 box">
	<li>1</li>
	<li>2</li>
	<li>3</li>
</ul>
<h1>横向排列时子元素基线对齐 box-align:baseline;</h1>
<ul class="box04 box">
	<li>1</li>
	<li>2</li>
	<li>3</li>
</ul>
<h1>横向排列时子元素自适应父元素 box-align:stretch;</h1>
<ul class="box05 box">
	<li>1</li>
	<li>2</li>
	<li>3</li>
</ul>
<h1>纵向排列时子元素从起始位置对齐 box-align:start;</h1>
<ul class="box0 box2">
	<li>1</li>
	<li>2</li>
	<li>3</li>
</ul>
<h1>纵向排列时子元素居中对齐 box-align:center;</h1>
<ul class="box02 box2">
	<li>1</li>
	<li>2</li>
	<li>3</li>
</ul>
<h1>纵向排列时子元素从结束位置对齐 box-align:end;</h1>
<ul class="box03 box2">
	<li>1</li>
	<li>2</li>
	<li>3</li>
</ul>
<h1>纵向排列时子元素基线对齐 box-align:baseline;</h1>
<ul class="box04 box2">
	<li>1</li>
	<li>2</li>
	<li>3</li>
</ul>
<h1>纵向排列时子元素自适应父元素 box-align:stretch;</h1>
<ul class="box05 box2">
	<li>1</li>
	<li>2</li>
	<li>3</li>
</ul>
</body>
</html>
			</textarea>
			<p><input type="button" class="g-btn g-btn-sure" value="运行"></p>
		</div>
	</section>
</section>
<footer id="ft">
	<aside id="rights" class="g-mod">
		<!-- 插入浏览器及版权信息 -->
	</aside>
</footer>
<script src="../../js/jquery.js"></script>
<script src="../../js/inner.js"></script>
</body>
</html>